#pragma once

#include <IXHotKey.h>
#include "XHwndImpl.h"


template <class I>
class CXHotKeyImpl : public CXHwndImpl<I>
{
    typedef CXHwndImpl<I> superclass;

    BEGIN_DEF_SKIN_CLASS(CXHotKey, superclass, gs_strGuidXSkin)
        IMP_BASIC_INTF(IXHotKey,    0)
    END_DEF_SKIN_CLASS();

    IMPL_CONTROL_OBJ(CXHotKeyImpl, superclass, _T("HotKey"));

public:
    CXHotKeyImpl();
    virtual ~CXHotKeyImpl();

public:
    // IXHwnd
    virtual DWORD   STDMETHODCALLTYPE   GetHwndFlags();
    virtual BOOL    STDMETHODCALLTYPE   OnCommand(UINT command);
    virtual HRESULT STDMETHODCALLTYPE   get_Text(IN BSTR* bstrText);

public:
    // IXHotKey
    virtual BOOL    STDMETHODCALLTYPE   GetHotKey(WORD &wVirtualKeyCode, WORD &wModifiers);
    virtual BOOL    STDMETHODCALLTYPE   SetHotKey(WORD wVirtualKeyCode, WORD wModifiers);

    virtual XString STDMETHODCALLTYPE   GetHotKeyName();

    virtual BOOL    STDMETHODCALLTYPE   SetRules(WORD wInvalidComb, WORD wModifiers);

public:
    // IXBaseObj
    virtual void STDMETHODCALLTYPE   OnFinalRelease();

protected:
    // CXHwndImpl Callback
    virtual XString GetHwndClassName();

    // CXControlImpl
    virtual HRESULT OnSkinLangChanged();

};


class CXHotKey : public CXHotKeyImpl<IXHotKey>
{
};
